package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 树形结构类型
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum OrganizationTreeType implements BaseEnum<Integer> {

    /** 树形结构类型-常规组织 */
    REGULAR_ORG(1, "常规组织"),
    /** 树形结构类型-虚拟组织 */
    VIRTUAL_ORG(2, "虚拟组织");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static OrganizationTreeType getByCode(Integer code) {
        return BaseEnum.getByCode(OrganizationTreeType.class, code);
    }

    @JsonCreator
    public static OrganizationTreeType getByName(String name) {
        return BaseEnum.getByName(name, OrganizationTreeType.class);
    }

}
